<template>
	<view class="contact">
		<image src="https://www.itcast.cn/2018czydz/images/gywmban.jpg" class="contact_img"></image>
		<view class="contact_info">
			<view @click="phone">联系电话: 15514455296 (点击拨打)</view>
			<view >联系地址: <text class="newmap" @click="getmap"> 广东省珠海市香洲区南屏镇广生</text></view>
		</view>
		<map class="map" enable-zoom :latitude="latitude" :longitude="longitude" :markers="markers"></map>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				longitude:113.481416,
				latitude:22.216262,
				markers:[
					{
						longitude:113.481416,
						latitude:22.216262,
						iconPath:'../../static/mapicon.jpg',
						width:40,
						height:40
					}
				]
			}
		},
		methods: {
			//拨打电话
			phone(){
				uni.makePhoneCall({
					phoneNumber:'15514455296'
				})
			},
			//调用地图导航
			getmap(){
				uni.openLocation({
				    latitude: Number(this.latitude),
				    longitude: Number(this.longitude),
					name:'南屏镇',
					address:'广东省珠海市南屏镇广生',
				    success: function () {
				        console.log('success');
				    }
				});
			},
		}
	}
</script>

<style scoped>
.contact_img{
	width: 750rpx;
	height: 320rpx;
}
.contact_info{
	font-size: 30rpx;
	line-height: 60rpx;
	padding: 10rpx 20rpx;
}
.map{
	width: 750rpx;
	height: 750rpx;
}
.newmap{
	color: #007AFF;
}
</style>
